//package com.neusoft.dibuy.service.impl;
//
//import com.neusoft.dibuy.service.IIpCounterService;
//import jakarta.servlet.http.HttpServletRequest;
//import org.springframework.beans.factory.annotation.Autowired;
//
//import java.util.HashMap;
//import java.util.Map;
//import java.util.Objects;
//
//
//public class IpCounterServiceImpl implements IIpCounterService {
//    @Autowired
//    HttpServletRequest request;
//
//    private static Map<String , Integer> map =new HashMap<>();
//
//    @Override
//    public void record() {
//
//        String ip =  request.getRemoteAddr();
//        System.out.println( "ip:" + ip );
//        Integer count = Objects.isNull( map.get( ip ))? 0 : map.get( ip );
//        map.put( ip , ++count );
//        map.forEach( (k,v)-> System.out.println( "Key : "  +  k + "Count:" + v ));
//    }
//}
